package com.scqkxx.gamebox.activity.activities.wigth;

import android.content.Context;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;

import com.scqkxx.gamebox.activity.activities.view.ImageAutoLoadScrollListener;

/**
 * Created by admin on 2018/8/14. 14点28分
 * name : ts
 * 用途： 处理RecyclerView的滑动事件
 */

public class XRecyclerView extends RecyclerView {

    private ImageAutoLoadScrollListener mImageAutoLoadScrollListener; //滑动监听

    public XRecyclerView(Context context) {
        this(context , null);
    }

    public XRecyclerView(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs , 0);
    }

    public XRecyclerView(Context context, @Nullable AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        init();
    }

    //进行初始化
    private void init() {
        mImageAutoLoadScrollListener = new ImageAutoLoadScrollListener(getContext().getApplicationContext());
        addOnScrollListener(mImageAutoLoadScrollListener);
    }

}
